package eqsolver;

public class Solver2 implements ISolver {
	private float a,b,c,delta;
	private float x[];

	public void solve(){
		
	}
	
	public Solver2(IEquation equation) {
		//TODO implementare algoritmo risoluz 2
	}
	
	public void setA(float a) {
		this.a = a;
	}

	public void setB(float b) {
		this.b = b;
	}
	
	public void setC(float c) {
		this.c = c;
	}
	
	public float[] getSolution(){
		
		x = new float[2];
		
		delta = b*b - 4*a*c;
		
		x[0]= (int)(-b + (float) Math.sqrt(delta))/(2*a);
		
		x[1]= (int)(-b - (float) Math.sqrt(delta))/(2*a);
		
		return x;
	}
}
